package com.neu.service;

import com.neu.dao.FloorDao;
import com.neu.pojo.Floor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FloorServiceImpl implements FloorService{
    @Autowired
    private FloorDao floorDao;

    @Override
    public int delFloor(int floorNum) {
        return floorDao.delFloor(floorNum);
    }

    @Override
    public int updateFloor(Floor floor) {
        return floorDao.updateFloor(floor);
    }


    @Override
    public int addFloor(Floor floor) {
        return floorDao.addFloor(floor);
    }

    @Override
    public List<Floor> getFloorByPage(int page, int limit) {
        return floorDao.getFloorByPage((page-1)*limit,limit);
    }

    @Override
    public int getFloorCount() {
        return floorDao.getFloorCount();
    }
}
